package com.gpframework.module.ctn.domain.req;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.gpframework.common.utils.StringUtils;
import com.gpframework.module.base.domain.req.BaseReq;
import com.gpframework.module.ctn.domain.GpSackInformation;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @ClassName GpSackInformationReq
 * @Author gpframework
 * @Date 2024-02-28
 * @Version 1.0.0
 * @Description 列表查询信息体
 */
@Data
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@Accessors(chain = true)
public class GpSackInformationFormReq extends BaseReq {
    private static final long serialVersionUID = 1L;

         @ApiModelProperty("${column.columnComment}")
     private Long id;
     @ApiModelProperty("订单ID")
     private Long receiptId;
     @ApiModelProperty("品牌名称")
     private String brandName;
     @ApiModelProperty("店铺名称")
     private String storeName;
     @ApiModelProperty("进仓单号")
     private String receiptNo;
     @ApiModelProperty("供应商名称")
     private String supplier;
     @ApiModelProperty("供应商号码")
     private String supplierTel;
     @ApiModelProperty("客户名")
     private String customer;
     @ApiModelProperty("客户电话号码")
     private String customerTel;
     @ApiModelProperty("是否扣货:0否 1是")
     private String holdOrNot;
    /** 是否核对;0未核对。1已核对。 */
    @ApiModelProperty(" 是否核对;0未核对。1已核对。")
    private String isCheck;
    /** 发送状态 0未发送，1已发送 */
    @ApiModelProperty("发送状态 0未发送，1已发送")
    private String sendStatus;
     @ApiModelProperty("单位")
     private String unit;
     @ApiModelProperty("散货重量（KG）")
     private BigDecimal sackWeight;
     @ApiModelProperty("散货数量")
     private Long sackNum;
     @ApiModelProperty("方cbm")
     private BigDecimal cbm;
     @ApiModelProperty("散货入仓件数")
     private Long sacksWarehousedNum;
     @ApiModelProperty("总箱数")
     private Integer sacksTotal;
     @ApiModelProperty("目的港")
     private String destination;
     @ApiModelProperty("散货货物描述")
     private String sackGoodsDescription;
     @ApiModelProperty("入仓仓库")
     private String warehouseName;
     @ApiModelProperty("操作人id")
     private Long operatorId;
     @ApiModelProperty("操作人")
     private String operatorName;
     @ApiModelProperty("排序")
     private Integer sort;
     @ApiModelProperty("备注")
     private String remarks;

    /** 定货柜ID */
    @ApiModelProperty("定货柜ID")
    private Long ctnOrderId;

    /** 货柜到市场发送短信时间 */
    @ApiModelProperty("货柜到市场发送短信时间")
    private Date smsToMarketDate;

    /** 装柜信息ID_装柜录入表 */
    @ApiModelProperty("装柜信息ID_装柜录入表")
    private Long ctnLoadedId;


    @ApiModelProperty("请求散货list")
    private List<GpSackInformationFormReq> gpSackInformationReqList;

    /**
    * @Description 生成查询wrapper
    * @Author greatplan@qq.com
    * @Date 2020-11-04 16:04
    * @Param [lqw]
    * @Param [isVO] 是否vo查询体，true的话走的是mapper.xml里面的查询语句，不过查询语法还是mybatis-plus，主要用于某些关联查询出一些非数据表字段
    * @Return void
    */
    public void generatorQuery(QueryWrapper<GpSackInformation> lqw,boolean isVo) {
        String alias = "";
        if (isVo) {
            alias = "sack.";
            lqw.eq(alias+"del_status",0);
        }
        if (this.getId() != null){
        lqw.eq(alias+"id" ,this.getId());
        }
        if (this.getReceiptId() != null){
        lqw.eq(alias+"receipt_id" ,this.getReceiptId());
        }
        if (StringUtils.isNotBlank(this.getBrandName())){
            lqw.like(alias+"brand_name",this.getBrandName());
        }
        if (StringUtils.isNotBlank(this.getStoreName())){
            lqw.like(alias+"store_name",this.getStoreName());
        }
        if (StringUtils.isNotBlank(this.getReceiptNo())){
        lqw.eq(alias+"receipt_no" ,this.getReceiptNo());
        }
        if (StringUtils.isNotBlank(this.getSupplier())){
        lqw.eq(alias+"supplier" ,this.getSupplier());
        }
        if (StringUtils.isNotBlank(this.getSupplierTel())){
        lqw.eq(alias+"supplier_tel" ,this.getSupplierTel());
        }
        if (StringUtils.isNotBlank(this.getCustomer())){
        lqw.eq(alias+"customer" ,this.getCustomer());
        }
        if (StringUtils.isNotBlank(this.getCustomerTel())){
        lqw.eq(alias+"customer_tel" ,this.getCustomerTel());
        }
        if (StringUtils.isNotBlank(this.getHoldOrNot())){
        lqw.eq(alias+"hold_or_not" ,this.getHoldOrNot());
        }
        if (StringUtils.isNotBlank(this.getUnit())){
        lqw.eq(alias+"unit" ,this.getUnit());
        }
        if (this.getSackWeight() != null){
        lqw.eq(alias+"sack_weight" ,this.getSackWeight());
        }
        if (this.getSackNum() != null){
        lqw.eq(alias+"sack_num" ,this.getSackNum());
        }
        if (this.getCbm() != null){
        lqw.eq(alias+"cbm" ,this.getCbm());
        }
        if (this.getSacksWarehousedNum() != null){
        lqw.eq(alias+"sacks_warehoused_num" ,this.getSacksWarehousedNum());
        }
        if (this.getSacksTotal() != null){
        lqw.eq(alias+"sacks_total" ,this.getSacksTotal());
        }
        if (StringUtils.isNotBlank(this.getDestination())){
        lqw.eq(alias+"destination" ,this.getDestination());
        }
        if (StringUtils.isNotBlank(this.getSackGoodsDescription())){
        lqw.eq(alias+"sack_goods_description" ,this.getSackGoodsDescription());
        }
        if (StringUtils.isNotBlank(this.getWarehouseName())){
            lqw.like(alias+"warehouse_name",this.getWarehouseName());
        }
        if (this.getOperatorId() != null){
        lqw.eq(alias+"operator_id" ,this.getOperatorId());
        }
        if (StringUtils.isNotBlank(this.getOperatorName())){
            lqw.like(alias+"operator_name",this.getOperatorName());
        }
        if (this.getSort() != null){
        lqw.eq(alias+"sort" ,this.getSort());
        }
        if (StringUtils.isNotBlank(this.getRemarks())){
        lqw.eq(alias+"remarks" ,this.getRemarks());
        }
    }
}
